<%@ page language="java" pageEncoding="UTF-8"%>
<div ng-controller="OpenApiCreateController" style="height: 800px;width:800px;">
	<form callback="save" validate>
		<div style="float: left;">
			<div class="form-group">
				<label>
					名称
				</label><br/>
				<input class="form-control" type="text" name="name" ng-model="openApi.name" rule="required;" />
			</div>
			<div class="form-group">
				<label>
					路径
				</label><br/>
				<input class="form-control" type="text" name="url" ng-model="openApi.url" />
			</div>
			<div class="form-group">
				<label>
					返回格式
				</label><br/>
				<input class="form-control" type="text" name="format" ng-model="openApi.format"/>
			</div>
			<div class="form-group">
				<label>
					请求方式
				</label><br/>
				<input class="form-control" type="text" name="request_type" ng-model="openApi.request_type" />
			</div>
			<div class="form-group">
				<label>
					父节点
				</label><br/>
				<select class="form-control" ng-model="openApi.parent" ng-init="openApi.parent=0">
					<option ng-repeat="root in roots" value="{{root.id}}">
						{{root.name}}
					</option>
				</select>
			</div>
			<div class="form-group">
				<label>
					索引
				</label><br/>
				<input class="form-control" type="text" name="index" ng-model="openApi.index" rule="required;integer[+];"/>
			</div>
			<div>
				<button type="submit" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-ok"/> 保存</button>
				<button type="button" class="btn btn-danger btn-sm" ng-click="cancel()"><i class="glyphicon glyphicon-remove"/> 取消</button>
			</div>
		</div>
		<div style="float: right;">
			<div class="form-group">
				<label>
					参数说明
				</label><br/>
				<textarea name="parameter" ng-model="openApi.parameter" editor-width="500" editor-height="200" editor>
				</textarea>
			</div>
			<div class="form-group">
				<label>
					方法说明
				</label><br/>
				<textarea name="explain" ng-model="openApi.explain" editor-width="500" editor-height="200" editor>
				</textarea>
			</div>
			<div class="form-group">
				<label>
					返回结果
				</label><br/>
				<textarea name="result" ng-model="openApi.result" editor-width="500" editor-height="200" editor>
				</textarea>
			</div>
		</div>
	</form>
</div>